﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace iRacingSdkWrapper
{
    public class SessionInfo
    {
        public SessionInfo(string yaml, float updateTime)
        {
            _UpdateTime = updateTime;
            _Yaml = yaml;

            this.CreateProperties();
        }

        private void CreateProperties()
        {
            this.WeekendInfo = new WeekendInfoContainer(this);
        }

        #region Properties

        private readonly float _UpdateTime;
        public float UpdateTime { get { return _UpdateTime; }}

        private readonly string _Yaml;
        public string Yaml { get { return _Yaml; } }

        #region Variables

        public WeekendInfoContainer WeekendInfo { get; private set; }

        #endregion

        #endregion

        #region Nested Classes

        public class WeekendInfoContainer
        {
            public WeekendInfoContainer(SessionInfo sessionInfo)
            {
                this.TrackName = new SessionInfoValue(sessionInfo, "WeekendInfo:TrackName:");
                this.TrackID = new SessionInfoValue(sessionInfo, "WeekendInfo:TrackID:");
            }

            public SessionInfoValue TrackName { get; private set; }
            public SessionInfoValue TrackID { get; private set; }
        }

        #endregion
    }
}
